package club.monkeywood.enums;

//后端api返回码字典
public enum ResponseEnum {

    SUCCESS(0, "SUCCESS"),
    ERROR(1, "ERROR"),
    NEED_LOGIN(10, "NEED_LOGIN"),
    ILLEGAL_ARGUMENT(11, "ILLEGAL_ARGUMENT"),
    PRODUCT_NOT_EXIST(12, "商品不存在"),
    PRODUCT_STOCK_ERROR(13, "库存不正确"),
    ORDER_NOT_EXIST(14, "订单不存在"),
    ORDERDETAIL_NOT_EXIST(15, "订单明细不存在"),
    ORDER_STATUS_ERROR(16, "订单状态不正确"),
    ORDER_UPDATE_FAIL(17, "订单更新失败"),
    ORDER_DETAIL_EMPTY(18,"订单详情为空"),
    ORDER_PAY_STATUS_ERROR(19, "订单支付状态不正确"),
    PARAM_ERROR(20, "参数错误"),
    CART_EMPTY(21, "购物车为空"),
    ORDER_OWNER_ERROR(22, "该订单不属于当前用户"),
    WECHAT_MP_ERROR(23, "微信公众账号方面错误"),
    WXPAY_NOTIFY_MONEY_VERIFY_ERROR(24, "微信支付异步通知金额校验不通过"),
    ORDER_CANCEL_SUCCESS(25, "订单取消成功"),
    ORDER_FINISH_SUCCESS(26, "订单完结成功"),
    PRODUCT_STATUS_ERROR(27, "商品状态不正确"),
    LOGIN_FAIL(28, "登录失败, 登录信息不正确"),
    LOGOUT_SUCCESS(29, "登出成功"),
    PRODUCTION_INSUFFICIENT_STOCK(30, "商品库存不足");

    private final int code;
    private final String desc;

    ResponseEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return code;
    }

    public String getDesc(){
        return desc;
    }

}